<?php
/*

 select * from orders
where openid in (select openid from  orders group by openid having count(openid) > 1);


select openid from  orders group by openid having count(openid) > 1


SELECT * FROM `uinfo` WHERE `memberno` IS NOT NULL AND `isold` LIKE 'new'
 */
if (isset($_GET['id']) && '1' == $_GET['id']){
    include 'load.php';
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {}
    
    $query=$mysqli->query("SELECT * FROM `orders` where isshot=0 limit 0,4 ");
    while ($list=$query->fetch_array()){
        var_dump($list);
        echo "<br />";
        $openid=$list['openid'];
        
        $queryU=$mysqli->query("SELECT * FROM `uinfo` where openid='".$openid."' limit 0,1 ");
        $getU=$queryU->fetch_array();
        echo $getU['isold'];
        echo "<br />";
        var_dump($getU);
        echo "<br />";
        
       
        if ('old' == $getU['isold']){
            $queryShare=$mysqli->query("SELECT * FROM `share` where openid='".$openid."' limit 0,5 ");
            echo 'count: ';
            echo count($getShare);
            echo "<br />";
            while ($getShare=$queryShare->fetch_array()){
                var_dump($getShare);
                echo "<br />";
            }
            echo "<br />";
        }
        
        echo '..............';
        echo "<br /><br />";
        
        
    }
    
}

echo 111;